// pages/swiper/swiper.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    swiperList:[],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad:  function(options){
    var that=this;
    let request = wx.request({
      url: 'https://pcw-api.iqiyi.com/resource/resource/online/200083812',
      data: {},
      header: {'content-type':'application/json'},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: (res)=>{
        console.log(res.data.data)
        that.setData({
          swiperList:res.data.data.items
        })
      },
      fail: (err)=>{
        console.log(err)
      },
    });
  },
  toSwiperInfo(e){
    console.log(e.currentTarget.dataset.value);
    app.globalData.value = e.currentTarget.dataset.value;
    wx.navigateTo({
      url: '../swiperInfo/swiperInfo',
    })
  }

 
})